package com.example.dagger2;

import android.app.Application;

import com.example.dagger2.di.DaggerPresenterComponent;
import com.example.dagger2.di.PresenterModule;

public class MyApplication extends Application {

    private MyComponent myComponent;

    @Override
    public void onCreate() {
        super.onCreate();
       myComponent = DaggerMyComponent.builder()
               .httpModule(new HttpModule())
               .databaseModule(new DatabaseModule())
               .presenterComponent(DaggerPresenterComponent.builder()
                       .presenterModule(new PresenterModule("lide")).build())
                .build();
    }

    public MyComponent getAppComponent() {
        return myComponent;
    }
}
